package es.truscoandrisco.discotecasmadrid;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import android.graphics.drawable.Drawable;


public class Evento{

	private String ID, disco, descripcion, fecha;
	private Drawable flyer = null;
	private Drawable logo = null;
	
	public Evento(String ID, String disco, String descripcion, String fecha, Drawable flyer, Drawable logo){
		this.ID = ID;
		this.disco = disco;
		this.descripcion = descripcion;
		this.flyer = flyer;
		this.logo = logo;
		this.fecha = fecha;
	}
	
	public String getID(){
		return this.ID;
	}
	
	public String getDisco(){
		return this.disco;
	}

	public String getDescripcion(){
		return this.descripcion;
	}
	
	public Drawable getFlyer(){
		return this.flyer;
	}
	
	public Drawable getLogo(){
		return this.logo;
	}
	
	public String getFecha(){
		return fecha;
	}

	public Drawable setLogo(String url, String srcName) throws MalformedURLException, IOException{
		logo = Drawable.createFromStream((InputStream) new URL(url).getContent(), srcName);
		return logo;
	}
	
	public Drawable setFlyer(String url, String srcName) throws MalformedURLException, IOException{
		flyer = Drawable.createFromStream((InputStream) new URL(url).getContent(), srcName);
		return flyer;
	}
	
}